#include "config.h"
namespace config
{
    const AliasedRequiredValue<std::string> trace_file = { "t", "trace_file", "trace file name"};
    const AliasedValue<uint64_t> run_cycle = {"c", "run_cycle", 10, "total run cycle"};
    const AliasedValue<uint64_t> run_inst = {"i", "run_inst", 10, "total run inst"};
} // namespace config

#include "pipeline.h"

uint64_t cycle = 0;

void sim_main(void) {
    std::cout << "using trace file : [" << config::trace_file << "]\n";  
    
    init_trace(config::trace_file);
    Pipeline pipeline;

    while (cycle < config::run_cycle && pipeline.retired_instruction < config::run_inst  && !pipeline.sim_finish)
    {
        pipeline.run();
        cycle++;
    }
    pipeline.print_counter();
}